<?php

use yii\helpers\Url;
use yii\helpers\Html;
use common\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model backend\models\Diploma */

$this->title = $model->BYZBH;
$this->params['breadcrumbs'][] = ['label' => 'Diplomas', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);
?>
<div class="diploma-view">

    <div class="panel">
		<div class="panel-heading no-print">
            <?= Html::encode($this->title) ?>          
            <div class="pull-right">                      
                <button id="btn-print" class="btn btn-sm btn-cyan" title="打印毕业证">打印毕业证</button>
            </div>
		</div>
        <div class="panel-body text-center">
            <img class="diploma" xsrc="<?= Url::to('@web/'.$model->BYZ) ?>"/>
            <div class="template">       
                <img class="diploma" src="<?= Url::to("@web/upload/diploma/{$model->BYND}/template.png") ?>"/>
                <span id="SFZHM"><?= $model->SFZHM ?></span>
                <span id="BYND"><?= $model->BYND ?></span>
                <span id="BYZBH"><?= $model->BYZBH ?></span>
                
                <span id="XSXM"><?= $model->XSXM ?></span>
                <span id="XB"><?= $model->XB ?></span>
                <span id="gR_birthday_y"><?= substr($model->gR->birthday,0,4) ?></span>
                <span id="gR_birthday_m"><?= substr($model->gR->birthday,5,2) ?></span>
                <span id="gR_birthday_d"><?= substr($model->gR->birthday,8,2) ?></span>
                
                <span id="RXSJ_y"><?= substr($model->RXSJ,0,4) ?></span>
                <span id="RXSJ_m"><?= substr($model->RXSJ,5,2) ?></span>
                <span id="LXSJ_y"><?= substr($model->LXSJ,0,4) ?></span>
                <span id="LXSJ_m"><?= substr($model->LXSJ,5,2) ?></span>
                
                <span id="bJ_zY_ZYMC"><?= $model->bJ->zY->ZYMC ?></span>  
                <span id="bJ_zY_ZYFX"><?= $model->bJ->zY->ZYFX ?></span>   
                <span id="bJ_zY_ZSLB"><?= str_replace('起点','',$model->bJ->zY->ZSLB) ?></span>   
                <span id="bJ_zY_JXXS"><?= $model->bJ->zY->JXXS ?></span>    
                <span id="bJ_zY_XZ"><?= $model->bJ->zY->XZ ?></span>   
                
                <span id="xX_ZWMC"><?= $model->xX->ZWMC ?></span>   
                
                <span id="FZRQ_y"><?= date('Y') //substr($model->FZRQ,0,4) ?></span>
                <span id="FZRQ_m"><?= date('m') //substr($model->FZRQ,5,2) ?></span>
                <span id="FZRQ_d"><?= date('d') //substr($model->FZRQ,8,2) ?></span>
                
            </div>
        </div>
    </div>

<style>
img.diploma{
    max-width: 100%;
}
.template{
    position: relative;
    color: black;
    font-size: 26px;
    line-height: 1em;
    text-align: center;
}
.template span{
    position: absolute; 
    z-index:1;
}

#SFZHM{ top:71.59%; left:18.38%; width:12em}
#BYND{ top:76.78%; left:23.64%; width:3em}
#BYZBH{ top:76.78%; left:30.20%; width:13em}

#XSXM, #XB, #gR_birthday_y{ top:13.63% }
#XSXM{ left:57.78%; width:5em }
#XB{ left:73.54%; width:1em }
#gR_birthday_y{ left:80.11%; width:4em }

#gR_birthday_m, #gR_birthday_d, #RXSJ_y{ top:19.77% }
#gR_birthday_m{ left:53.84%; width:2em  }
#gR_birthday_d{ left:61.72%; width:2em  }
#RXSJ_y{ left:80.11%; width:4em  }

#RXSJ_m, #LXSJ_y, #LXSJ_m{ top:25.72% }
#RXSJ_m{ left:53.84%; width:2em  }
#LXSJ_y{ left:65.00%; width:4em  }
#LXSJ_m{ left:76.82%; width:2em  }

#bJ_zY_ZYMC{ top:31.86%; left:53.84%; width:16em}
#bJ_zY_ZYFX{ top:37.72%; left:53.84%; width:7em}
#bJ_zY_ZSLB{ top:37.72%; left:78.79%; width:5em}

#bJ_zY_JXXS, #bJ_zY_XZ{ top:43.67% }
#bJ_zY_JXXS{ left:57.12%; width:5em }
#bJ_zY_XZ{ left:78.79%; width:4em }

#xX_ZWMC{ top:72.74%; left:60.41%; width:16em}

#FZRQ_y, #FZRQ_m, #FZRQ_d{ top:80.42% }
#FZRQ_y{ left:63.03%; width:4em}
#FZRQ_m{ left:75.51%; width:2em}
#FZRQ_d{ left:84.04%; width:2em}

@media print{
    .no-print{
        display: none;
    }
    .wrap, .wrap .container,
    .panel, .panel-body{
        margin:0;
        padding:0;
    }
}
</style>
</div>
